<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>商品列表</title>
</head>
<body>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
      href="${pageContext.request.contextPath}/static/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
      href="${pageContext.request.contextPath}/static/css/bootstrap/css/default.css">
<!-- Custom styles for this template -->
<link href="${pageContext.request.contextPath}/static/css/carousel.css"
      rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.js"></script>
<script src="${pageContext.request.contextPath}/static/js/functions.js"></script>
<script src="${pageContext.request.contextPath}/static/js/cart.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/static/css/bootstrap/js/bootstrap.min.js"></script>

<c:import url="../common/userTopNav.jsp"/>

<div class="container-fluid">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <h3>订单信息</h3>
            <table class="table table-condensed table-hover">
                <tbody>
                <tr>
                    <td>订单编号：${orderVo.order.oid}</td>
                    <td>创建时间：<fmt:formatDate value="${orderVo.order.date}" pattern="yyyy-MM-dd"/></td>
                </tr>
                <tr>
                    <td>
                        订单状态：
                        <span id="orderStatus">
                                <c:if test="${orderVo.order.status==-3}">交易关闭</c:if>
                                <c:if test="${orderVo.order.status==-2}">退款成功</c:if>
                                <c:if test="${orderVo.order.status==-4}">退货成功</c:if>
                                <c:if test="${orderVo.order.status==-1}">已提交退款申请，请等待商家处理</c:if>
                                <c:if test="${orderVo.order.status==-5}">已提交退货申请，请等待商家处理</c:if>
                                <c:if test="${orderVo.order.status==0}">等待付款</c:if>
                                <c:if test="${orderVo.order.status==1}">未发货</c:if>
                                <c:if test="${orderVo.order.status==2}">已发货</c:if>
                                <c:if test="${orderVo.order.status==3}">交易成功</c:if>
							  </span>
                    </td>
                    <td>送货地址：${orderVo.order.address}</td>
                </tr>
                </tbody>
            </table>

        </div>
        <div class="col-md-10 col-md-offset-1">
            <div class="panel panel-info">
                <div class="panel-heading">商品列表</div>
                <div class="panel-body">
                    <table class="table table-hover table-condensed">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>商品图片</th>
                            <th>商品名称</th>
                            <th>商品单价</th>
                            <th>数量</th>
                            <th>小计</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${orderVo.itemList}" var="item" varStatus="status">
                            <c:if test="${not empty item.product.name}">
                                <tr>
                                    <td>${status.count}</td>
                                    <td>
                                        <img src="${item.product.url}" width="30" height="30">
                                    </td>
                                    <td>
                                            ${item.product.name}&nbsp;&nbsp;
                                            ${item.item.size}&nbsp;&nbsp;${item.item.color}
                                    </td>
                                    <td>
                                        单价<span class="glyphicon glyphicon-yen"
                                                aria-hidden="true"></span>${item.product.offPrice}
                                    </td>
                                    <td>
                                            ${item.item.count}
                                    </td>
                                    <td>
                                        <span class="glyphicon glyphicon-yen" aria-hidden="true"></span>
                                            ${item.item.subtotal}
                                    </td>
                                </tr>
                            </c:if>
                            <c:if test="${empty item.product.name}">
                                <tr>
                                    <center><B>商品${status.count}已下架</B></center>
                                </tr>
                            </c:if>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <table class="table table-condensed">
                <tr>
                    <td class="text-right">运费：<span class="glyphicon glyphicon-yen"
                                                    aria-hidden="true"></span>${orderVo.order.freight}
                    </td>
                </tr>
                <tr>
                    <td class="text-right">订单总金额（含运费）：<span class="glyphicon glyphicon-yen"
                                                            aria-hidden="true"></span>${orderVo.order.total}
                    </td>
                </tr>
            </table>
            <div class="col-md-12 text-right">
                <button class="btn btn-primary" id="back" type="button"
                        onclick="javascript:location.href='${pageContext.request.contextPath}/order/getMyOrders'">
                    返回订单列表
                    <%--onclick="javascript:location.href='${pageContext.request.contextPath}/order/getMyOrders?pageNum=2'">返回订单列表--%>
                </button>
            </div>
        </div>
    </div>
</div>
<c:import url="../common/userFooter.jsp"/>
</body>
</html>